home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Professional Soft Collection 1.02
/
Professional Soft Collection 1.02.iso
/
dmf_ps2.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-23
|
10KB
|
297 lines
/* */
/*
* ********************************************************************
* * Copyright (c) IBM Corporation, 1995 *
* * All Rights Reserved *
* ********************************************************************
*
*
* DESCRIPTION: This REXX command file is to be used to make changes
* to CONFIG.SYS for IBM Microchannel PS/2's in order
* to install Microsoft applications that are in DMF
* format on your IBM PS/2 Microchannel system.
*
*/
/* trace I */
call init
/* Get the version of the current OS/2 system. */
version = SysOs2Ver()
if version < '2.30' then /* 2.30 represents Warp version. */
do
say 'é φΓ«⌐ óÑαß¿¿ OS/2 ñá¡¡δ⌐ ¬«¼á¡ñ¡δ⌐ Σá⌐½ ¡Ñ αáí«ΓáÑΓ.'
say 'Åα«úαá¼¼á ºáóÑαΦÑ¡á.'
exit
end
"@cls"
Say ' '
Say ' '
Say ' '
Say '¥Γá »α«úαá¼¼á »«ºó«½∩ÑΓ »«½∞º«óáΓѽ∩¼ OS/2 Warp, αáí«ΓáεΘ¿¼ ¡á'
Say '¬«¼»∞εΓÑαáσ IBM PS/2, ¿¡ßΓá½½¿α«óáΓ∞ »α«úαá¼¼¡δÑ ßαÑñßΓóá,'
Say '»«ßΓáó½∩ѼδÑ ¡á ñ¿ß¬ÑΓáσ, »«ñú«Γ«ó½Ñ¡¡δσ ó ¡ÑßΓá¡ñáαΓ¡«¼ Σ«α¼áΓÑ DMF.'
Say ' '
Say '¥Γá »α«úαá¼¼á ¿º¼Ñ¡¿Γ Σá⌐½ CONFIG.SYS, τΓ«íδ «íÑß»Ñτ¿Γ∞'
Say 'τΓÑ¡¿Ñ ñ¿ß¬ÑΓ DMF. Å«ß½Ñ ¿¡ßΓá½½∩µ¿¿ »α«úαá¼¼¡δσ ßαÑñßΓó DMF'
Say 'ß¡«óá óδ»«½¡¿ΓÑ φΓπ »α«úαá¼¼π, π¬áºáó αѪ¿¼ é,'
Say 'τΓ«íδ ó«ßßΓá¡«ó¿Γ∞ »Ñαó«¡áτá½∞¡δ⌐ Σá⌐½ CONFIG.SYS.'
Say ' '
Say 'ùΓ«íδ ¿º¼Ñ¡¿Γ∞ Σá⌐½ CONFIG.SYS OS/2 Warp, «íÑß»Ñτ¿óáεΘ¿⌐'
Say '»«ññÑαª¬π ¿¡ßΓá½½∩µ¿¿ ß ñ¿ß¬ÑΓ Σ«α¼áΓá DMF, óóÑñ¿ΓÑ ê'
Say ' '
Say 'ùΓ«íδ «Γ¬áºáΓ∞ß∩ «Γ ¿º¼Ñ¡Ñ¡¿⌐ ó Σá⌐½Ñ CONFIG.SYS OS/2 Warp,'
Say 'ßó∩ºá¡¡δσ ß DMF, óóÑñ¿ΓÑ é'
Say ' '
Say 'ùΓ«íδ óδ⌐Γ¿ ¿º φΓ«⌐ »α«úαá¼¼δ, ¡¿τÑú« ¡Ñ ¼Ñ¡∩∩, óóÑñ¿ΓÑ ¢'
Say ' '
Say 'ÄΓóÑΓ∞ΓÑ ê (꺼ѡ¿Γ∞), é (é«ßßΓá¡«ó¿Γ∞) ¿½¿ ¢ (éδσ«ñ).'
parse upper pull answer . /* Get the answer */
if (answer='¢' | answer='é¢òÄä') then /* If answer is exit then exit */
say 'éδσ«ñ ¿º ¬«¼á¡ñ¡«ú« Σá⌐½á!'
else if (answer='éÄææÆÇìÄéêÆ£' | answer='é') then
call UNDO /* If the answer is UNDO then go to the UNDO Subroutine */
else if (answer='ê' | answer = 'êçîàìêÆ£') then
do /* If the answer is Modify then modify config.sys */
'@cls'
say ' '
say ' '
say ' '
say 'ìá ¬á¬«¼ πßΓα«⌐ßΓóÑ ¿¡ßΓá½½¿α«óá¡á «»Ñαᵿ«¡¡á∩ ß¿ßΓѼá OS/2 Warp?'
say 'éóÑñ¿ΓÑ íπ¬óπ πßΓα«⌐ßΓóá ¿½¿ »πΓ∞ (¡á»α¿¼Ñα, C:\)'
say ''
/* Check whether the given drive is valid. */
call Checkdrive /* GO to the Checkdrive subroutine */
fname=drive'\config.sys' /* Assign drive letter and path for config.sys */
/* Check whether config.sys exists. */
call sysfiletree fname, 'files.', 'F'
if files.0 < 1 then
do
say 'öá⌐½ CONFIG.SYS ¡Ñ ¡á⌐ñÑ¡.'
say 'Åα«úαá¼¼á ºáóÑαΦÑ¡á.'
exit
end
sname=drive'\config.dmf' /* Assign drive letter and path to */
/* config.sys back up file name */
/* Check whether config.dmf exists. */
call sysfiletree sname, 'files.', 'F'
if files.0 >= 1 then
do
say 'öá⌐½ Config.dmf ßπΘÑßΓóπÑΓ. éδ σ«Γ¿ΓÑ Ñú« »ÑαѺỿßáΓ∞ (ä/ì)?'
parse upper pull answer
answer = left(answer,1)
if answer = 'ì' then
do
say 'ÅαѪñÑ τѼ »«óΓ«α¡« óδ»«½¡¿Γ∞ dmf_ps2,'
say '»ÑαÑ¿¼Ñ¡π⌐ΓÑ ¿½¿ πñ὿ΓÑ Σá⌐½ config.dmf.'
exit
end
end
nname=drive'\config1.tmp' /* Assign drive letter and path to */
/* temporary file */
say 'éδ»«½¡Ñ¡¿Ñ .......'
say ' '
"@copy" fname sname ">nul 2>nul" /* Backup config.sys */
call lineout nname,,1
do while lines(fname) /* Parse through config.sys looking for */
str = linein(fname) /* the string to be modified */
basedev = (substr(str,1,20)) /* Only need to look at first 20 */
/* characters of the line */
select
when substr(basedev,1,20) == 'BASEDEV=IBM1FLPY.ADD' then do
if left(reverse(str), 4) \= 'ACM/' then do
call lineout nname, str '/MCA' /* Add /MCA option to */
end /* IBM1FLPY.ADD driver */
else
call lineout nname, str
end
when substr(basedev,1,20) == 'BASEDEV=IBM2FLPY.ADD' then do
call lineout nname, 'REM' str /* REM out the */
end /* IBM2FLPY.ADD driver */
otherwise do
call lineout nname, str
end
end
end
call lineout fname
call lineout nname
"@copy" nname fname ">nul 2>nul"
"@erase" nname
"@cls"
say ''
say ''
say ''
say ''
say '꺼ѡѡ Σá⌐½' fname
say ''
say 'öá⌐½ CONFIG.SYS ¿º¼Ñ¡Ñ¡. ÅÑαó«¡áτá½∞¡á∩ ¬«»¿∩ φΓ«ú« Σá⌐½á'
say 'ß«σαá¡Ñ¡á ó Σá⌐½Ñ CONFIG.DMF. ä½∩ Γ«ú«, τΓ«íδ ¿º¼Ñ¡Ñ¡¿∩ óßΓπ»¿½¿'
say 'ó ß¿½π, ºá¬α«⌐ΓÑ «»Ñαᵿ«¡¡πε ß¿ßΓÑ¼π ¿ »ÑαѺáúαπº¿ΓÑ ¬«¼»∞εΓÑα.'
say ''
say 'Åα¿½«ªÑ¡¿∩ DMF πªÑ ¿¡ßΓá½½¿α«óá¡δ. ùΓ«íδ ó«ßßΓá¡«ó¿Γ∞ ß¿ßΓѼπ'
say 'ó »Ñαó«¡áτá½∞¡«Ñ ß«ßΓ«∩¡¿Ñ, »«óΓ«α¡« óδ»«½¡¿ΓÑ DMF_PS2'
say 'ß αѪ¿¼«¼ é (é«ßßΓá¡«ó¿Γ∞).'
end
else
say 'ÄΓóÑΓ ¡Ñ αáß»«º¡á¡.'
say 'Åα«úαá¼¼á ºáóÑαΦÑ¡á.'
exit
UNDO:
'@cls'
say ' '
say ' '
say ' '
say 'ìá ¬á¬«¼ πßΓα«⌐ßΓóÑ ¿¡ßΓá½½¿α«óá¡á «»Ñαᵿ«¡¡á∩ ß¿ßΓѼá OS/2 Warp?'
say 'éóÑñ¿ΓÑ íπ¬óπ πßΓα«⌐ßΓóá ¿½¿ »πΓ∞ (¡á»α¿¼Ñα, C:\)'
say ' '
call Checkdrive
fname=drive'\config.sys'
call sysfiletree fname, 'files.', 'F'
if files.0 < 1 then
do
say 'öá⌐½ CONFIG.SYS ¡Ñ ¡á⌐ñÑ¡.'
say 'Åα«úαá¼¼á ºáóÑαΦÑ¡á.'
exit
end
nname=drive'\config1.tmp'
do while lines(fname) /* This section of code is to check the */
str = linein(fname) /* config.sys to see if the DMF changes */
basedev = (substr(str,1,24)) /* need to be UNDone. */
select
when substr(basedev,1,20) == 'BASEDEV=IBM2FLPY.ADD' then do
"@CLS"
say ' ' /* If it finds this then display */
say ' ' /* Message */
say ' '
say 'é Σá⌐½Ñ CONFIG.SYS ¡ÑΓ ¿º¼Ñ¡Ñ¡¿⌐ «Γ¡«ß¿Γѽ∞¡« DMF'
say 'ÄΓ¼Ñ¡∩Γ∞ ¡ÑτÑú«'
say 'Åα«úαá¼¼á ºáóÑαΦÑ¡á.'
call exit
end
when substr(basedev,1,24) == 'REM BASEDEV=IBM2FLPY.ADD' then do
call lineout nname
call lineout fname /* If it finds this then lets */
call undo2 /* call undo2 to really undo the */
end /* DMF changes */
otherwise do
call lineout nname, str
end
end
end
EXIT:
call lineout nname
"@ERASE" nname
exit
UNDO2:
"@erase" nname
nname=drive'\config1.tmp'
call lineout nname,,1
do while lines(fname)
str = linein(fname)
basedev = (substr(str,1,24))
select
when substr(basedev,1,24) == 'REM BASEDEV=IBM2FLPY.ADD' then do
newstr = (subword(str,2))
call lineout nname, newstr
end
when substr(basedev,1,20) == 'BASEDEV=IBM1FLPY.ADD' then do
parse var str final remaining
num_item = words(remaining)
do p = 1 to num_item
if strip(word(remaining, p)) \= '/MCA' then
final = final || ' 'word(remaining, p)
end
call lineout nname, final
end
otherwise do
call lineout nname, str
end
end
end
call lineout fname
call lineout nname
"@copy" nname fname ">nul 2>nul"
"@erase" nname
"@cls"
say ''
say ''
say ''
say ''
say 'öá⌐½ CONFIG.SYS ó«ßßΓá¡«ó½Ñ¡. ä½∩ Γ«ú«, τΓ«íδ ¿º¼Ñ¡Ñ¡¿∩ óßΓπ»¿½¿'
say 'ó ß¿½π, ºá¬α«⌐ΓÑ «»Ñαᵿ«¡¡πε ß¿ßΓÑ¼π ¿ »ÑαѺáúαπº¿ΓÑ ¬«¼»∞εΓÑα.'
say ''
exit
CheckDrive:
/* Get all the local drive letters. */
drivemap = sysdrivemap('c:', 'LOCAL')
parse upper pull drive .
drive = strip(translate(drive, ' ', '\'))
num_item = words(drive)
if num_item > 1 then
do
say 'ôßΓα«⌐ßΓó« ¡Ñ αáß»«º¡á¡«.'
say 'Åα«úαá¼¼á ºáóÑαΦÑ¡á.'
exit
end
found = 'NO'
do while drivemap \= ''
parse var drivemap head tail
drivemap = tail
head = strip(head)
if head = drive then
found = 'YES'
end
if found = 'NO' then
do
say 'ôßΓα«⌐ßΓó« ¡Ñ αáß»«º¡á¡«.'
say 'Åα«úαá¼¼á ºáóÑαΦÑ¡á.'
end
return
/* Load in the extra function library. WPW001 */
Init: Procedure
/* Load in the extra function library */
if RxFuncQuery('SysLoadFuncs') then do
Call RXFuncAdd 'SysLoadFuncs','RexxUtil','SysloadFuncs'
end
Call SysLoadFuncs
return